package com.example.interceptmybatis.config;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @ClassName Result
 * @Description TODO
 * @Author 郭敖
 * @Date 2024年06月28日 22:07
 * @Version 1.0
 */
@Data
@Accessors(chain = true)
public class Result<T> {
    private int code;
    private T data;
    private String msg;

    public static <T>  Result<T> Success(T data){
        Result<T> result = new Result<T>();
        return result.setCode(200)
                .setData(data)
                .setMsg("success");
    }

    public static <T> Result<T> Success(){
        return Success(null);
    }
}
